package agentsSME;

//import java.util.HashMap;
import java.util.LinkedList;

import main.Organization;
import otherOrganizations.ServiceCompany;
import enviornment.FloodWarning;
/**
 * Receives alerts from the message senders.
 * @author Chunhui Li
 *
 */

public class MsgReceiver {
	
	private LinkedList<FloodWarning> receiver; // save messages received from senders
 //   private LinkedList<Organization> senders;
    private LinkedList<Message> messages;
	/**
	 * The constructor.
	 */
	public MsgReceiver() {
		receiver = new LinkedList<FloodWarning>();
//		senders= new LinkedList<Organization>();
		messages = new LinkedList<Message>();
	}
	
    public void receiveFloodMsg(FloodWarning msg){
    	receiver.add(msg);
    }
    /*
    public void getContactedByCustomers(SME sme){
    	senders.add(sme);
    }
    public void getContactedByService(ServiceCompany s){
    	senders.add(s);
    }*/
    public void receiveMessage(Message m){
    	messages.add(m);
    }
    public LinkedList<FloodWarning> getAlerts(){
    	return receiver;
    }
    /*
    public LinkedList<Organization> getContactList(){
    	return senders;
    }*/
    public LinkedList<Message> getReceivedMessages(){
    	return messages;
    }
}
